package com.xcdh.ittools.utils;

import com.alibaba.druid.pool.DruidDataSource;
import com.api.ittools.entity.ToolDatasource;

/**
 * DataSourceUtil
 * Created by wjg on 2024/4/10.
 */
public class DataSourceUtil {

    public static DruidDataSource toolDsToDrDs(ToolDatasource toolDatasource){
        DruidDataSource dataSource = new DruidDataSource() ;
        dataSource.setPassword(toolDatasource.getPassword());
        dataSource.setDriverClassName(toolDatasource.getDriverClass());
        dataSource.setUsername(toolDatasource.getUsername());
        dataSource.setUrl(toolDatasource.getDsUrl());
        return dataSource;
    }
}
